tar xf ${DOWNLOADDIR}/grub-2.12.tar.xz -C ${BUILDDIR}
pushd ${BUILDDIR}/grub-2.12
	tar xf ${DOWNLOADDIR}/grub2-patches.tar.gz
	while read f
	do
	  patch -Np1 -i patches/$f
        done < patches/series

	autoreconf -ifv

        echo depends bli part_gpt > grub-core/extra_deps.lst
	mkdir cross-build
	pushd cross-build
		unset CFLAGS
		unset LDFLAGS
		../configure --prefix=/usr  --libdir=/usr/lib64  --build=${CROSS_HOST} \
		             --host=${CROSS_TARGET} -with-platform=efi \
                             --target=${CROSS_TARGET} \
		             --disable-werror
		make ${JOBS}
		make DESTDIR=${SYSDIR}/sysroot install
	popd
popd
